package com.yxdj.order.api.factory;

import com.yxdj.common.core.domain.R;
import com.yxdj.order.api.RemoteOrderService;
import com.yxdj.order.api.domain.OrderInfo;
import org.springframework.cloud.openfeign.FallbackFactory;

public class RemoteOrderFallbackFactory implements FallbackFactory<RemoteOrderService> {
    @Override
    public RemoteOrderService create(Throwable cause) {
        return new RemoteOrderService() {
            @Override
            public R<OrderInfo> getOrderInfoById(Long id, String source) {
                return R.fail("调用订单模块失败："+cause.getMessage());
            }
        };
    }
}
